<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>jquery中常见的一些事件</title>
    <!--焦点focus blur-->
    <script src="/jquery-3.2.1.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("input").focus(function () {
                console.log("focus() run");
                $(this).val("获取了焦点");
            });
            $("input").blur(function () {
                console.log("blur() run");
                $(this).val("失去了焦点");
            });
        });
    </script>
</head>
<body>
<input type="text">
<input type="text">
</body>
</html>